Optimal. Leaf size=113 \[ -\frac {\log (x) (a+b x) (A b-a B)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {(a+b x) (A b-a B) \log (a+b x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x} \]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {769, 646, 36, 29, 31} \begin {gather*} -\frac {\log (x) (a+b x) (A b-a B)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {(a+b x) (A b-a B) \log (a+b x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 646
Rule 769
Rubi steps
\begin {align*} \int \frac {A+B x}{x^2 \sqrt {a^2+2 a b x+b^2 x^2}} \, dx &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac {\left (2 A b^2-2 a b B\right ) \int \frac {1}{x \sqrt {a^2+2 a b x+b^2 x^2}} \, dx}{2 a b}\\ &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac {\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac {1}{x \left (a b+b^2 x\right )} \, dx}{2 a b \sqrt {a^2+2 a b x+b^2 x^2}}\\ &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}+\frac {\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac {1}{a b+b^2 x} \, dx}{2 a^2 \sqrt {a^2+2 a b x+b^2 x^2}}-\frac {\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac {1}{x} \, dx}{2 a^2 b^2 \sqrt {a^2+2 a b x+b^2 x^2}}\\ &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac {(A b-a B) (a+b x) \log (x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {(A b-a B) (a+b x) \log (a+b x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 57, normalized size = 0.50 \begin {gather*} \frac {(a+b x) (\log (x) (a B x-A b x)+x (A b-a B) \log (a+b x)-a A)}{a^2 x \sqrt {(a+b x)^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [B] time = 0.88, size = 480, normalized size = 4.25 \begin {gather*} \frac {\frac {2 \sqrt {b^2} B x \tanh ^{-1}\left (\frac {\sqrt {a^2+2 a b x+b^2 x^2}-\sqrt {b^2} x}{a}\right )}{a}-\frac {2 B \sqrt {a^2+2 a b x+b^2 x^2} \tanh ^{-1}\left (\frac {\sqrt {a^2+2 a b x+b^2 x^2}-\sqrt {b^2} x}{a}\right )}{a}-\frac {2 A b}{a}}{\sqrt {a^2+2 a b x+b^2 x^2}-\sqrt {b^2} x}-\frac {2 A b \left (\sqrt {a^2+2 a b x+b^2 x^2}-\sqrt {b^2} x\right )^2 \tanh ^{-1}\left (\frac {\sqrt {b^2} x}{a}-\frac {\sqrt {a^2+2 a b x+b^2 x^2}}{a}\right )}{a^2 \left (-2 \sqrt {b^2} x \sqrt {a^2+2 a b x+b^2 x^2}+a^2+2 a b x+2 b^2 x^2\right )}+\frac {-2 A \sqrt {b^2} \sqrt {a^2+2 a b x+b^2 x^2} \left (a^2+4 a b x+4 b^2 x^2\right )-2 A \left (-a^3 b-5 a^2 b^2 x-8 a b^3 x^2-4 b^4 x^3\right )}{\sqrt {a^2+2 a b x+b^2 x^2} \left (-2 a^3 b x-12 a^2 b^2 x^2-24 a b^3 x^3-16 b^4 x^4\right )+\sqrt {b^2} \left (2 a^4 x+14 a^3 b x^2+36 a^2 b^2 x^3+40 a b^3 x^4+16 b^4 x^5\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.43, size = 41, normalized size = 0.36 \begin {gather*} -\frac {{\left (B a - A b\right )} x \log \left (b x + a\right ) - {\left (B a - A b\right )} x \log \relax (x) + A a}{a^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 81, normalized size = 0.72 \begin {gather*} \frac {{\left (B a \mathrm {sgn}\left (b x + a\right ) - A b \mathrm {sgn}\left (b x + a\right )\right )} \log \left ({\left | x \right |}\right )}{a^{2}} - \frac {A \mathrm {sgn}\left (b x + a\right )}{a x} - \frac {{\left (B a b \mathrm {sgn}\left (b x + a\right ) - A b^{2} \mathrm {sgn}\left (b x + a\right )\right )} \log \left ({\left | b x + a \right |}\right )}{a^{2} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 61, normalized size = 0.54 \begin {gather*} \frac {\left (b x +a \right ) \left (-A b x \ln \relax (x )+A b x \ln \left (b x +a \right )+B a x \ln \relax (x )-B a x \ln \left (b x +a \right )-A a \right )}{\sqrt {\left (b x +a \right )^{2}}\, a^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.51, size = 106, normalized size = 0.94 \begin {gather*} -\frac {\left (-1\right )^{2 \, a b x + 2 \, a^{2}} B \log \left (\frac {2 \, a b x}{{\left | x \right |}} + \frac {2 \, a^{2}}{{\left | x \right |}}\right )}{a} + \frac {\left (-1\right )^{2 \, a b x + 2 \, a^{2}} A b \log \left (\frac {2 \, a b x}{{\left | x \right |}} + \frac {2 \, a^{2}}{{\left | x \right |}}\right )}{a^{2}} - \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} A}{a^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.49, size = 117, normalized size = 1.04 \begin {gather*} \frac {A\,a\,b\,\mathrm {atanh}\left (\frac {a^2+b\,x\,a}{\sqrt {a^2}\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}\right )}{{\left (a^2\right )}^{3/2}}-\frac {A\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}{a^2\,x}-\frac {B\,\ln \left (a\,b+\frac {a^2}{x}+\frac {\sqrt {a^2}\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}{x}\right )}{\sqrt {a^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.40, size = 95, normalized size = 0.84 \begin {gather*} - \frac {A}{a x} + \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a b + B a^{2} - a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} - \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a b + B a^{2} + a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________